<%@page import="com.jsp.study.db.BookWithPage"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>图书分页查询</title>
</head>
<body>
	<table align="center" width="450px;">
		<tr>
			<td align="center" colspan="5">
				<h2>所有图书信息</h2>
				<hr>
			</td>
		</tr>
		<tr align="center">
			<td><b>图书ID</b></td>
			<td><b>图书名称</b></td>
			<td><b>图书价格</b></td>
			<td><b>图书数量</b></td>
			<td><b>图书作者</b></td>
		</tr>
		<%
			List<BookWithPage> bookList = (List<BookWithPage>)request.getAttribute("list");
			if (bookList != null && bookList.size() > 0) {
				for (BookWithPage book : bookList) {
		%>
					<tr align="center">
						<td><%= book.getId() %></td>
						<td><%= book.getName() %></td>
						<td><%= book.getPrice() %></td>
						<td><%= book.getBookCount() %></td>
						<td><%= book.getAuthor() %></td>
					</tr>
		<%
				}
		%>
				<tr>
					<td align="center" colspan="5">
						<%= request.getAttribute("bar") %>
					</td>
				</tr>
		<%
			} else {
		%>
				<tr>
					<td align="center" colspan="5">暂无图书信息</td>
				</tr>
		<%
			}
		%>
	</table>
</body>
</html>